﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Tradex;
using Tradex.Market;
using Tradex.Trading;

namespace Tradex.Connectivity.ConnectorModel {

    /// <summary>
    /// This is the callback interface used by a connector to provide updated market information to Tradex.
    /// This includes market updates as well as instrument information.
    /// </summary>
    public interface IMarketConnectorCallback {

        /// <summary>
        /// This callback indicates the arrival of new market data.
        /// </summary>
        /// <param name="instrumentKey">The key of the instrument the update refers to.</param>
        /// <param name="update">The market update.</param>
        void Activity (
            InstrumentKey instrumentKey, Activity update
        );

        /// <summary>
        /// This function call updates the metadata of an instrument. It is legal for the
        /// connector to fill ot only one of the attached data blocks. This should be done when the
        /// underlying API does not provide the information in one block.
        /// </summary>
        /// <param name="instrumentKey">The key of the instrument the update refers to.</param>
        /// <param name="instrumentInfo">The instrument info - null if none is provided.</param>
        /// <param name="instrumentPricing">The instrument pricing - null if none is provided.</param>
        void InstrumentUpdate(
            InstrumentKey instrumentKey, InstrumentInfo instrumentInfo, InstrumentPricing instrumentPricing
        );

    }

}
